<%@ page import="java.util.List" %>
<%@ page import="R.Entity.Record" %>
<%@page pageEncoding="UTF-8" contentType="text/html; UTF-8" isELIgnored="false" %>
<!doctype html>
<html>
    <head>
        <meta charset="UTF-8">
        <meta name="viewport"
              content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
        <meta http-equiv="X-UA-Compatible" content="ie=edge">
        <title>查询挂号信息</title>
        <link rel="stylesheet" href="/res/css/RegShowAll.css" type="text/css"/>
    </head>
    <body>
        <p>挂号服务</p>
        <form action="/RegShowAll" method="post">
            <div id="div1">
                <button><a href="/R/reg.jsp">挂号入口</a></button>
            </div>
            <div id="div2">输入挂号单编号<input type="text" name="RegistrationID"/></div>
            <div id="div3">就诊卡号<input type="text" name="CardID"/></div>
            <input type="submit" value="查询"/>
        </form>
        <table border="0" frame=hsides>
            <tr>
                <th>挂号编号</th>
                <th>就诊卡号</th>
                <th>门诊类型</th>
                <th>病人姓名</th>
                <th>病人性别</th>
                <th>病人年龄</th>
                <th>挂号科室</th>
                <th>挂号类型</th>
                <th>挂号医生</th>
                <th>挂号时间</th>
                <th>工作人员</th>
                <th>操作</th>
            </tr>
            <%
                List<Record> list = (List<Record>) request.getAttribute("RegList");
                if (list != null) {
                    for (int i = 0; i < list.size(); i++) {
                        Record r = list.get(i);
                        out.println("<tr>");
                        out.println("<td>" + r.getRegistrationID() + "</td>");//挂号编号
                        out.println("<td>" + r.getCardID() + "</td>");//就诊卡号
                        out.println("<td>" + r.getRegType() + "</td>");//门诊类型
                        out.println("<td>" + r.getName() + "</td>");//病人姓名
                        out.println("<td>" + r.getGender() + "</td>");//病人性别
                        out.println("<td>" + r.getAge() + "</td>");//病人年龄
                        out.println("<td>" + r.getDoctorName() + "</td>");//挂号科室
                        out.println("<td>" + r.getRegType() + "</td>");//挂号类型
                        out.println("<td>" + r.getDoctorName() + "</td>");//挂号医生
                        out.println("<td>" + r.getRegDate() + "</td>");//挂号时间
                        out.println("<td>" + r.getOperator() + "</td>");//工作人员
                        out.println("<td><a href='/RegEditServlet?RegistrationID="+r.getRegistrationID()+"'>改号</a>&nbsp;&nbsp;");
                        out.println("<a href='/RegDelServlet?RegistrationID="+r.getRegistrationID()+"'>退号</a></td>");
                        out.println("</tr>");
                    }
                }
            %>
        </table>
    </body>
</html>